package com.example.testdemo.service;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.example.testdemo.R;

/**
 * Created by MrYan on 2018/9/13.
 */

public class MyServiceActivity extends Activity {
    Intent intent;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acivity_service);
        intent = new Intent(this, MyService.class);
        intent.putExtra("tag","abcd");
    }

    public void startServiced(View view) {
        startService(intent);

    }

    public void stopServiced(View view) {
        stopService(intent);
    }
}
